/**********************************************
这是代码自动生成的，如果重新生成，所做的改动将会丢失
系统:gpssolution
模块:系统平台
Itop.com 版权所有
生成者：Rabbit
生成时间:2012-8-8 13:48:58
***********************************************/

using System;
using System.Threading;
using System.ComponentModel;
namespace Itop.GpsCar.Model
{
    /// <summary>
    ///[device]业务实体类
    ///对应表名:device
    /// </summary>
    [Serializable]
    public class device
    {
        
        #region Private 成员
        private int _device_id=0; 
        private string _device_serial=String.Empty; 
        private int _auth_id=0; 
        private int _device_type=0; 
        private string _device_model=String.Empty; 
        private DateTime _device_expire=new DateTime(1900,1,1); 
        private string _device_desc=String.Empty; 
        private DateTime _device_made_date=new DateTime(1900,1,1); 
        private int _sim_id=0; 
        private string _server_list=String.Empty; 
        private int _server_list_version=0; 
        private string _allowed_list=String.Empty; 
        private int _allowed_list_version=0; 
        private int _interval=0; 
        private int _software_version=0; 
        private string _redirection_info=String.Empty; 
        private DateTime _timestamp=new DateTime(1900,1,1); 
        private string _reserved_1=String.Empty; 
        private string _reserved_2=String.Empty;   
        #endregion
  
  
        #region Public 成员
   
        /// <summary>
        /// 属性名称：device_id
        /// 属性描述：
        /// 字段信息：[device_id],INT UNSIGNED
        /// </summary>
        [Browsable(false)]
        [DisplayNameAttribute("")]
        public int device_id
        {
            get { return _device_id; }
            set
            {			
                if (_device_id as object == null || !_device_id.Equals(value))
                {
                    _device_id = value;
                }
            }			 
        }
  
        /// <summary>
        /// 属性名称：device_serial
        /// 属性描述：
        /// 字段信息：[device_serial],VARCHAR
        /// </summary>
        [DisplayNameAttribute("")]
        public string device_serial
        {
            get { return _device_serial; }
            set
            {			
                if(value==null)return;
                if( value.ToString().Length > 36)
                throw new Exception("[device_serial]长度不能大于36!");
                if (_device_serial as object == null || !_device_serial.Equals(value))
                {
                    _device_serial = value;
                }
            }			 
        }
  
        /// <summary>
        /// 属性名称：auth_id
        /// 属性描述：
        /// 字段信息：[auth_id],INT UNSIGNED
        /// </summary>
        [DisplayNameAttribute("")]
        public int auth_id
        {
            get { return _auth_id; }
            set
            {			
                if (_auth_id as object == null || !_auth_id.Equals(value))
                {
                    _auth_id = value;
                }
            }			 
        }
  
        /// <summary>
        /// 属性名称：device_type
        /// 属性描述：
        /// 字段信息：[device_type],INT
        /// </summary>
        [DisplayNameAttribute("")]
        public int device_type
        {
            get { return _device_type; }
            set
            {			
                if (_device_type as object == null || !_device_type.Equals(value))
                {
                    _device_type = value;
                }
            }			 
        }
  
        /// <summary>
        /// 属性名称：device_model
        /// 属性描述：
        /// 字段信息：[device_model],VARCHAR
        /// </summary>
        [DisplayNameAttribute("")]
        public string device_model
        {
            get { return _device_model; }
            set
            {			
                if(value==null)return;
                if( value.ToString().Length > 45)
                throw new Exception("[device_model]长度不能大于45!");
                if (_device_model as object == null || !_device_model.Equals(value))
                {
                    _device_model = value;
                }
            }			 
        }
  
        /// <summary>
        /// 属性名称：device_expire
        /// 属性描述：
        /// 字段信息：[device_expire],DATETIME
        /// </summary>
        [DisplayNameAttribute("")]
        public DateTime device_expire
        {
            get { return _device_expire; }
            set
            {			
                if (_device_expire as object == null || !_device_expire.Equals(value))
                {
                    _device_expire = value;
                }
            }			 
        }
  
        /// <summary>
        /// 属性名称：device_desc
        /// 属性描述：
        /// 字段信息：[device_desc],VARCHAR
        /// </summary>
        [DisplayNameAttribute("")]
        public string device_desc
        {
            get { return _device_desc; }
            set
            {			
                if(value==null)return;
                if( value.ToString().Length > 50)
                throw new Exception("[device_desc]长度不能大于50!");
                if (_device_desc as object == null || !_device_desc.Equals(value))
                {
                    _device_desc = value;
                }
            }			 
        }
  
        /// <summary>
        /// 属性名称：device_made_date
        /// 属性描述：
        /// 字段信息：[device_made_date],DATE
        /// </summary>
        [DisplayNameAttribute("")]
        public DateTime device_made_date
        {
            get { return _device_made_date; }
            set
            {			
                if (_device_made_date as object == null || !_device_made_date.Equals(value))
                {
                    _device_made_date = value;
                }
            }			 
        }
  
        /// <summary>
        /// 属性名称：sim_id
        /// 属性描述：
        /// 字段信息：[sim_id],INT
        /// </summary>
        [DisplayNameAttribute("")]
        public int sim_id
        {
            get { return _sim_id; }
            set
            {			
                if (_sim_id as object == null || !_sim_id.Equals(value))
                {
                    _sim_id = value;
                }
            }			 
        }
  
        /// <summary>
        /// 属性名称：server_list
        /// 属性描述：
        /// 字段信息：[server_list],VARCHAR
        /// </summary>
        [DisplayNameAttribute("")]
        public string server_list
        {
            get { return _server_list; }
            set
            {			
                if(value==null)return;
                if( value.ToString().Length > 50)
                throw new Exception("[server_list]长度不能大于50!");
                if (_server_list as object == null || !_server_list.Equals(value))
                {
                    _server_list = value;
                }
            }			 
        }
  
        /// <summary>
        /// 属性名称：server_list_version
        /// 属性描述：
        /// 字段信息：[server_list_version],INT UNSIGNED
        /// </summary>
        [DisplayNameAttribute("")]
        public int server_list_version
        {
            get { return _server_list_version; }
            set
            {			
                if (_server_list_version as object == null || !_server_list_version.Equals(value))
                {
                    _server_list_version = value;
                }
            }			 
        }
  
        /// <summary>
        /// 属性名称：allowed_list
        /// 属性描述：
        /// 字段信息：[allowed_list],VARCHAR
        /// </summary>
        [DisplayNameAttribute("")]
        public string allowed_list
        {
            get { return _allowed_list; }
            set
            {			
                if(value==null)return;
                if( value.ToString().Length > 150)
                throw new Exception("[allowed_list]长度不能大于150!");
                if (_allowed_list as object == null || !_allowed_list.Equals(value))
                {
                    _allowed_list = value;
                }
            }			 
        }
  
        /// <summary>
        /// 属性名称：allowed_list_version
        /// 属性描述：
        /// 字段信息：[allowed_list_version],INT UNSIGNED
        /// </summary>
        [DisplayNameAttribute("")]
        public int allowed_list_version
        {
            get { return _allowed_list_version; }
            set
            {			
                if (_allowed_list_version as object == null || !_allowed_list_version.Equals(value))
                {
                    _allowed_list_version = value;
                }
            }			 
        }
  
        /// <summary>
        /// 属性名称：interval
        /// 属性描述：
        /// 字段信息：[interval],INT
        /// </summary>
        [DisplayNameAttribute("")]
        public int interval
        {
            get { return _interval; }
            set
            {			
                if (_interval as object == null || !_interval.Equals(value))
                {
                    _interval = value;
                }
            }			 
        }
  
        /// <summary>
        /// 属性名称：software_version
        /// 属性描述：
        /// 字段信息：[software_version],INT UNSIGNED
        /// </summary>
        [DisplayNameAttribute("")]
        public int software_version
        {
            get { return _software_version; }
            set
            {			
                if (_software_version as object == null || !_software_version.Equals(value))
                {
                    _software_version = value;
                }
            }			 
        }
  
        /// <summary>
        /// 属性名称：redirection_info
        /// 属性描述：This allow device to connect a third party private server, it contain server ip, port, and auth token
        /// 字段信息：[redirection_info],VARCHAR
        /// </summary>
        [DisplayNameAttribute("This allow device to connect a third party private server")]
        public string redirection_info
        {
            get { return _redirection_info; }
            set
            {			
                if(value==null)return;
                if( value.ToString().Length > 45)
                throw new Exception("[This allow device to connect a third party private server]长度不能大于45!");
                if (_redirection_info as object == null || !_redirection_info.Equals(value))
                {
                    _redirection_info = value;
                }
            }			 
        }
  
        /// <summary>
        /// 属性名称：timestamp
        /// 属性描述：
        /// 字段信息：[timestamp],TIMESTAMP
        /// </summary>
        [DisplayNameAttribute("")]
        public DateTime timestamp
        {
            get { return _timestamp; }
            set
            {			
                if (_timestamp as object == null || !_timestamp.Equals(value))
                {
                    _timestamp = value;
                }
            }			 
        }
  
        /// <summary>
        /// 属性名称：reserved_1
        /// 属性描述：
        /// 字段信息：[reserved_1],VARCHAR
        /// </summary>
        [DisplayNameAttribute("")]
        public string reserved_1
        {
            get { return _reserved_1; }
            set
            {			
                if(value==null)return;
                if( value.ToString().Length > 45)
                throw new Exception("[reserved_1]长度不能大于45!");
                if (_reserved_1 as object == null || !_reserved_1.Equals(value))
                {
                    _reserved_1 = value;
                }
            }			 
        }
  
        /// <summary>
        /// 属性名称：reserved_2
        /// 属性描述：
        /// 字段信息：[reserved_2],VARCHAR
        /// </summary>
        [DisplayNameAttribute("")]
        public string reserved_2
        {
            get { return _reserved_2; }
            set
            {			
                if(value==null)return;
                if( value.ToString().Length > 45)
                throw new Exception("[reserved_2]长度不能大于45!");
                if (_reserved_2 as object == null || !_reserved_2.Equals(value))
                {
                    _reserved_2 = value;
                }
            }			 
        }
  
        #endregion 
  
        #region 方法
        public static string Newid(){
            return DateTime.Now.ToString("yyyyMMddHHmmssffffff");
        }
        public string CreateID(){
            Thread.Sleep(new TimeSpan(100000));//0.1毫秒
            return DateTime.Now.ToString("yyyyMMddHHmmssffffff");
        }
        #endregion		
    }	
}
